<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<title>{$_title}{$_config['web_title'] ? ('-' . $_config['web_title']) : ''}</title>
	<meta name="keywords" content="{$_config['web_keywords']}" />
	<meta name="description" content="{$_config['web_description']}" />
	<meta name="renderer" content="webkit">
	
	<link rel="stylesheet" type="text/css" href="../public/css/login.css" />

	<script type="text/javascript" src="__PUBLIC__js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__js/jquery-plugin/jquery.md5.js"></script>
	<script type="text/javascript" src="../public/js/common.js"></script>
</head>
<body>
	
<div class="wrap">
	<div class="login-box">
		<div class="logo"><a href="{:url('/')}"><i class="icon-logo"></i></a></div>
		<div class="switch-box">
			<div class="title">
				<span class="pc-login">账号登录</span>
				<span class="scan-login on">扫码注册/登录</span>
			</div>
			<form class="pc-login-box" action="" method="post">
				<div class="form-group">
					<input name="username" type="text" placeholder="手机号" autocomplete="off">
				</div>
				<div class="form-group">
					<input name="password" type="password" placeholder="密码">
				</div>
				<div class="form-group">
					<button type="submit">立即登录</button>
				</div>
			</form>
			<div class="weixin-login-box">
				<img src="{:url('weixin_login_qrcode')}" width="200" height="200">
				<div class="desc icon-use-weixin-desc"></div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
var weixin_status;
$(document).ready(function () {
	$('.switch-box .title span').click(function () {
		window.clearTimeout(weixin_status);
		$('.switch-box .title span').removeClass('on');
		if($(this).hasClass('pc-login')){
			$(this).addClass('on');
			$('.pc-login-box').show();
			$('.weixin-login-box').hide();
		}else{
			$('.pc-login-box').hide();
			$('.weixin-login-box').show();
			$(this).addClass('on');
			weixin_login_status(1);
		}
	});
	weixin_login_status(1);
});
function weixin_login_status(time) {
	$.ajax({
		type: "get",
		url: "{:url('weixin_login_status')}",
		dataType:"json",
		success: function(data){
			if(data.code == 1){
				msgbox(data.msg);
				if(data.url){
					jumpurl(data.url);
				}
			}else{
				if(data.data.is_tips){
					msgbox(data.msg, 'error', '', 5);
					if(data.url){
						jumpurl(data.url);
					}
				}
			}
		},
		error :function (data) {
			msgbox('请求失败，请稍候再试！', 'error');
		}
	});
	var time = time ? time : 3;
	weixin_status = setTimeout("weixin_login_status(" + time + ")", time * 1000);
}
</script>
</body>
</html>